package com.jcl.cloud.services.crawler.catchnew.controller;


import com.jcl.cloud.services.crawler.catchnew.service.CatchNewManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(
        value = {"/catch-new/api/v1"},
        produces = {"application/json"}
)
public class TaskController {


   @Autowired
   private CatchNewManagerService catchNewManagerService;


    @RequestMapping(
            value = {"/manager/tasks"},
            method = {RequestMethod.GET}
    )
    public void createTask(String crawlerId){
        try {
            this.catchNewManagerService.createCatchNewTask(crawlerId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
